home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / contrib / pdcurs22 / src / flexos / _16bitmo.c next >
Encoding:
C/C++ Source or Header  |  1995-01-26  |  2.2 KB  |  72 lines

  1. /*
  2. ***************************************************************************
  3. * This file comprises part of PDCurses. PDCurses is Public Domain software.
  4. * You may use this code for whatever purposes you desire. This software
  5. * is provided AS IS with NO WARRANTY whatsoever.
  6. * Should this software be used in another application, an acknowledgement
  7. * that PDCurses code is used would be appreciated, but is not mandatory.
  8. *
  9. * Any changes which you make to this software which may improve or enhance
  10. * it, should be forwarded to the current maintainer for the benefit of 
  11. * other users.
  12. *
  13. * The only restriction placed on this code is that no distribution of
  14. * modified PDCurses code be made under the PDCurses name, by anyone
  15. * other than the current maintainer.
  16. * See the file maintain.er for details of the current maintainer.
  17. ***************************************************************************
  18. */
  19. #define    CURSES_LIBRARY    1
  20. #include <curses.h>
  21.  
  22. #ifdef    PDCDEBUG
  23. char *rcsid__16bitmo  = "$Id$";
  24. #endif
  25.  
  26.  
  27.  
  28.  
  29. #ifdef    FLEXOS
  30. /*man-start*********************************************************************
  31.  
  32.   _flexos_16bitmode()    - Puts console 16 bit mode.
  33.  
  34.   PDCurses Description:
  35.      This routine sets 16 bit mode (8 bit character +
  36.      8 bit attribute) for Flexos.
  37.  
  38.   PDCurses Return Value:
  39.      This function returns OK on success and ERR on error.
  40.  
  41.   PDCurses Errors:
  42.      Under FLEXOS, an ERR will be returned if the s_get() call
  43.      fails, or if the s_set() call fails.  You are referred to
  44.      the Flexos Programmer's Reference Guide for details on the
  45.      actual error.
  46.  
  47.   Portability:
  48.      PDCurses    int _flexos_16bitmode( void );
  49.  
  50. **man-end**********************************************************************/
  51.  
  52. int    _flexos_16bitmode(void)
  53. {
  54. extern    VIRCON    vir;        /* Allocate a Virtual Console Structure */
  55.  
  56.     retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  57.     if (retcode < 0L)
  58.         return( ERR );
  59.  
  60.     vir.vc_kbmode = vir.vc_kbmode | (VCKM_NABORT | VCKM_NSTOP |
  61.                      VCKM_NXLAT  | VCKM_NESC  |
  62.                      VCKM_16BIT  | VCKM_NECHO |
  63.                      VCKM_NEOF);
  64.  
  65.     vir.vc_smode = vir.vc_smode | VCSM_16BIT;
  66.  
  67.     retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  68.     return( (retcode < 0L) ? ERR : OK );
  69. }
  70. #endif
  71.